<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Copyright 2012 David Menting <david@nut-bolt.nl>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

-%>
<%
	local ver = require "luci.version"
	local disp = require "luci.dispatcher"

	local request  = disp.context.path

	local category = request[1]

	local tree = disp.node()

	local categories = disp.node_childs(tree)
%>
</td>
    <td class="m_con_right"></td>
  </tr>
  <tr>
    <td class="m_bot_left"></td>
    <td class="m_bot_content"></td>
    <td class="m_bot_right"></td>
  </tr>
</table>
 </div>
</div>
<div class="clear"></div>
<footer>Copyright @ 2015中国联通股份有限公司
   </footer>
  <script type="text/javascript">
  var cookie = {  
	set: function(key, value, days) {  
	document.cookie = 'tomato_' + key + '=' + value + '; expires=' +  
	(new Date(new Date().getTime() + ((days ? days : 14) * 86400000))).toUTCString() + '; path=/';  
	},  
	get: function(key) {  
	var r = ('; ' + document.cookie + ';').match('; tomato_' + key + '=(.*?);');  
	return r ? r[1] : null;  
	},  
	unset: function(key) {  
	document.cookie = 'tomato_' + key + '=; expires=' +  
	(new Date(1)).toUTCString() + '; path=/';  
	}  
	};
	
	  function getQuery(para){  
		  var reg = new RegExp("(^|&)"+para +"=([^&]*)(&|$)");  
		  var r =  window.location.search.substr(1).match(reg);  
		  if(r!=null){  
		   return unescape(r[2]);   
		  }  
		  return null;  
	 }   
	 var num=getQuery("num");
	 if(num==null&&cookie.get("num")==null) num=0;
	 else if(num==null&&cookie.get("num")!=null){
		num=cookie.get("num")
	 }else if(num!=null){
	 	cookie.set("num",num);
	 }
	 
  		document.getElementById("rightContent").style.width=(document.body.clientWidth-183)+"px";
		var contents = document.getElementsByClassName('content');
		var toggles = document.getElementsByClassName('type');
	
		var myAccordion = new fx.Accordion(
			toggles, contents, {opacity: true, duration: 400}
		);
		myAccordion.showThisHideOpen(contents[num-1]);
	</script>
</body>
</html>


